#ifndef _RETRO_API
#define _RETRO_API

#define API_InvalidArgument() \
  DEBUG_OUTPUT(_T("Argument Invalid at ") ## _T(__FUNCTION__))

#define API_DeclareFunction(f) \
  VOID API##f(Scripting::ScriptInterface* iScript)

#define API_AddFunction(f) \
  iScript->add(API##f, #f)

#define API_AddObject(n, ...) \
  {Scripting::ScriptValue _APIVALUES[] = {__VA_ARGS__}; \
  iScript->add(_APIVALUES, \
  sizeof(_APIVALUES) / sizeof(_APIVALUES[0]), n);}

#define API_MakeFunction(f, n) \
  { API##f, Retro::Scripting::TypeFunction, n }

#define API_MakeObject(t, n) \
  { t, Retro::Scripting::TypeObject, n, ARRAYSIZE(t) }

#define API_DeclareAPI(n) \
  VOID n##(Scripting::ScriptManager* iScript)

#define API_DefineAPI(n) \
  VOID n##(Scripting::ScriptManager* iScript)

namespace Retro
{
  namespace Scripting
  {
    DLLEXPORT API_DeclareAPI(InitializeAPI);
  }
}

#endif
